package com.plz.afmt.enums;

public enum CacheKeyEnum {

    LOGIN_TOKEN_KEY("login_token:", "login_token:"),
    UPVOTE("upvote:","upvote:"),
    GPT_KEY("","");


    private String code;
    private String value;

    private CacheKeyEnum(String code, String value) {
        this.code = code;
        this.value = value;
    }

    /**
     * 定义一个静态方法,通过code返回枚举常量对象
     *
     * @param code
     * @return
     */
    public static CacheKeyEnum getValue(String code) {
        for (CacheKeyEnum excelType : values()) {
            if (excelType.getCode().equals(code)) {
                return excelType;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

}
